 export default function createElement(vnode) {
  let domNode = document.createElement(vnode.sel);
  if (
    vnode.text !== "" &&
    (vnode.children === undefined || vnode.children.length === 0)
  ) {
    domNode.innerText = vnode.text;
  } else if (Array.isArray(vnode.children) && vnode.children.length > 0) {
    for (let ch of vnode.children) {
      let chDOM = createElement(ch);
      domNode.appendChild(chDOM);
    }
  }
  vnode.elm = domNode;
  return domNode;
}